# define _CRT_SECURE_NO_WARNINGS 1
#include "BinaryTree.h"

int main()
{
	BTNode* A = (BTNode*)malloc(sizeof(BTNode));
	A->data = 'A';

	BTNode* B = (BTNode*)malloc(sizeof(BTNode));
	B->data = 'B';

	BTNode* C = (BTNode*)malloc(sizeof(BTNode));
	C->data = 'C';

	BTNode* D = (BTNode*)malloc(sizeof(BTNode));
	D->data = 'D';

	BTNode* E = (BTNode*)malloc(sizeof(BTNode));
	E->data = 'E';

	BTNode* F = (BTNode*)malloc(sizeof(BTNode));
	F->data = 'F';

	BTNode* G = (BTNode*)malloc(sizeof(BTNode));
	F->data = 'G';

	BTNode* H = (BTNode*)malloc(sizeof(BTNode));
	F->data = 'H';

	BTNode* I = (BTNode*)malloc(sizeof(BTNode));
	F->data = 'I';

	BTNode* J = (BTNode*)malloc(sizeof(BTNode));
	F->data = 'J';

	BTNode* K = (BTNode*)malloc(sizeof(BTNode));
	F->data = 'K';

	BTNode* L = (BTNode*)malloc(sizeof(BTNode));
	F->data = 'L';

	BTNode* M = (BTNode*)malloc(sizeof(BTNode));
	F->data = 'M';


	A->left = B;
	A->right = NULL;
	B->left = C;
	B->right = G;
	C->left = D;
	C->right = E;
	D->left = NULL;
	D->right = F;
	F->left = NULL;
	F->right = NULL;
	E->left = NULL;
	E->right = NULL;
	G->left = NULL;
	G->right = H;
	H->left = I;
	H->right = NULL;
	I->left = J;
	I->right = L;
	J->left = NULL;
	J->right = K;
	K->left = NULL;
	K->right = NULL;
	L->left = M;
	L->right = NULL;
	M->left = NULL;
	M->right = NULL;


	PrevOrder(A);
	printf("\n");
	InOrder(A);
	printf("\n");
	PostOrder(A);
	printf("\n");



	//A->left = B;
	//A->right = C;
	//B->left = D;
	//B->right = E;
	//C->left = NULL;
	//C->right = NULL;
	//D->left = F;
	//D->right = NULL;
	//E->left = NULL;
	//E->right = NULL;
	//D->right = NULL;
	//F->left = F->right = NULL;
//	                                                                                  A
	//PrevOrder(A);                                                               B       C
	//InOrder(A);                                                              D     E
	//PostOrder(A);                                                         F
	//int size = 0;
	//TreeSize(A, &size);
	////int ret = TreeSize(A);
	//printf("%d\n", size);
	//printf("%d\n", TreeLeafSize(A));
	//printf("%d\n", MaxDepth(A));
	//printf("%c\n", PostFirst(A)->data);
	//printf("%c\n", PrevLast(A)->data);
	return 0;
}